                <div id="content" class="span10">
                    <!-- content starts -->
                    <div class="row-fluid sortable">
                        <div class="box span12">
                            <div class="box-content">
                                <form class="form-horizontal" action="<?php echo base_url();?>lap/month" method="post">
                                  <fieldset>
                                    <legend></legend>
                                    <div class="row-fluid">
                                        <div class="span4">
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Bulan</label>
                                                <div class="controls">
                                                    <select id="bulan" name="bulan" data-rel="chosen">
                                                        <option selected disabled value="1">Pilih bulan</option>
                                                        <option value="1">Januari</option>
                                                        <option value="2">Febuari</option>
                                                        <option value="3">Maret</option>
                                                        <option value="4">April</option>
                                                        <option value="5">Mei</option>
                                                        <option value="6">Juni</option>
                                                        <option value="7">Juli</option>
                                                        <option value="8">Agustus</option>
                                                        <option value="9">September</option>
                                                        <option value="10">Oktober</option>
                                                        <option value="11">November</option>
                                                        <option value="12">Desember</option>
                                                    </select>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span4">
                                            <div class="control-group">
                                                <label class="control-label" for="typeahead">Tahun</label>
                                                <div class="controls">
                                                    <input type="text" class="span8 typeahead" name="tahun" id="tahun" >
                                                </div>
                                            </div>
                                        </div>
                                        <div class="span4">
                                                <button type="submit" class="btn btn-primary">Submit</button>
                                                <button type="reset" class="btn">Cancel</button>
                                        </div>
                                    </div>
                                    </fieldset>
                                </form>
                            </div>
                        </div>
                        <!--/span-->
                    </div>
                    <h2>
                    <?php
                    if (!empty($bln)){
                        echo "Laporan Bulan ";
                        switch ($bln) {
                            case 1  : echo "Januari";
                            break;
                            case 2  : echo "Februari";
                            break;
                            case 3  : echo "Maret";
                            break;
                            case 4  : echo "April";
                            break;
                            case 5  : echo "Mei";
                            break;
                            case 6  : echo "Juni";
                            break;
                            case 7  : echo "Juli";
                            break;
                            case 8  : echo "Agustus";
                            break;
                            case 9  : echo "September";
                            break;
                            case 10 : echo "Oktober";
                            break;
                            case 11 : echo "November";
                            break;
                            case 12 : echo "Desember";
                            break;
                        }
                        echo " ";
                        echo $thn;
                    } 
                    else {
                        echo "Laporan Bulan ";
                        switch (date("m")) {
                            case 1  : echo "Januari";
                            $bln = 1;
                            break;
                            case 2  : echo "Februari";
                            $bln = 2;
                            break;
                            case 3  : echo "Maret";
                            $bln = 3;
                            break;
                            case 4  : echo "April";
                            $bln = 4;
                            break;
                            case 5  : echo "Mei";
                            $bln = 5;
                            break;
                            case 6  : echo "Juni";
                            $bln = 6;
                            break;
                            case 7  : echo "Juli";
                            $bln = 7;
                            break;
                            case 8  : echo "Agustus";
                            $bln = 8;
                            break;
                            case 9  : echo "September";
                            $bln = 9;
                            break;
                            case 10 : echo "Oktober";
                            $bln = 10;
                            break;
                            case 11 : echo "November";
                            $bln = 11;
                            break;
                            case 12 : echo "Desember";
                            $bln = 12;
                            break;
                        }
                        echo " ";
                        echo date("Y");
                        $thn =date("Y");
                    }
                    
                    ?>
                </h2>
                    <?php
                    if (empty($laporan)){
                        echo "tidak ada data";
                    } 
                    else {
                    
                    ?>
                    <a class="btn btn-primary" href="<?php echo base_url() ?>cetakr/month/<?php echo $bln."/".$thn ?>">Download Laporan</a>
                    <div class="row-fluid sortable">
                        <div class="box span12">
                            <div class="box-content">
                                <table class="table table-striped table-bordered bootstrap-datatable datatable">
                                    <thead>
                                        <tr>
                                            <th>No Normalisasi</th>
                                            <th>Nama</th>
                                            <th>Sisa Bulan Lalu</th>
                                            <th>Masuk ke Rayon</th>
                                            <th>Kembali ke Area</th>
                                            <th>Sisa Bulan Ini</th>
                                        </tr>
                                    </thead>
                                    
                                    <tbody>
                                        <?php
                                    foreach ($laporan as $row) {
                                    ?>
                                        <tr>
                                            <td><?=$row['kodebarang']?></td>
                                            <td><?=$row['nama']?></td>
                                            <td><?=$row['awal']?></td>
                                            <td><?=$row['masuk']?></td>
                                            <td><?=$row['keluar']?></td>
                                            <td><?php echo ($row['awal']+$row['masuk']-$row['keluar'])?></td>
                                        </tr>
                                        <?php
                                        } 
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <!--/span-->
                    </div>
                    <?php 
                }
                    ?>
                    <!--/row-->
                    <!-- content ends -->
                </div>
                <!--/#content.span10-->